package com.ibm.risk.irmp.workflow.client.flowable;

import com.ibm.risk.irmp.common.auth.AuthUtils;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
public class FlowableClientTestApp {
    public static void main(String[] args) {
        SpringApplication.run(FlowableClientTestApp.class, args);
    }

    @Bean
    public AuthUtils.AuthUserHolder init() {
        AuthUtils.AuthUserHolder dummy = new AuthUtils.AuthUserHolder() {
            @Override
            public String getLoginUsername() {
                return "UNIT_TEST_DUMMY_USER";
            }
        };
        return AuthUtils.init(dummy);
    }

    @Bean
    public RestTemplate restTemplate() {
        RestTemplate restTemplate = new RestTemplate();
//        restTemplate.getMessageConverters().add(new ByteArrayListHttpMessageConverter());
        return restTemplate;
    }
}
